package com.bdqn.service;

import com.bdqn.mapper.SysUserMapper;
import com.bdqn.pojo.SysUser;
import com.bdqn.util.MyBatisUtil;

/**
 * SysUserServiceImpl
 *
 * @author LILIBO
 * @since 2021-09-15
 */
public class SysUserServiceImpl implements SysUserService {

    /**
     * 获取接口实现（使用全局SqlSession，可能存在系统安全问题）
     */
    private SysUserMapper sysUserMapper = MyBatisUtil.sqlSession.getMapper(SysUserMapper.class);

    /**
     * 根据用户名和密码查询用户对象
     *
     * @param account
     * @param password
     * @return
     */
    @Override
    public SysUser getSysUserByAccountAndPassword(String account, String password) {
        SysUser sysUser = null;
        if (account == null || password == null) {
            return null;
        }
        sysUser = sysUserMapper.getSysUserByAccountAndPassword(account, password);
        return sysUser;
    }
}
